import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useCommentStore = defineStore('comment', () => {
    const comments = ref<Array<comment>>([])
    function addComment(username: string, musicListId: string, content: string) {
        let likeItem = {
            id: comments.value.length + 1,
            username: username,
            musicListId: musicListId,
            content: content
        }
        comments.value.push(likeItem)
    }
    return { comments, addComment }
})

interface comment {
    id: Number,
    username: String,
    musicListId: String,
    content: String
}[]